package com.xxx.mapper;

import com.xxx.pojo.Dish;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface DishMapper {


    @Insert("insert into dish values (#{name},#{typesName},#{price},#{id},#{img},#{describe},#{state},#{order},#{createTime},#{updateTime},#{createUser},#{updateUser}, #{dele})")
    int addDish(Dish dish);

    @Select("select * from dish;")
    @ResultMap("dishResultMap")
    List<Dish> selectAll();

    @Select("select * from dish where dish_id = #{id};")
    @ResultMap("dishResultMap")
    Dish selectById(Long id);

    int updateDish(@Param("column") String column, @Param("data") String data, @Param("updateTime") String updateTime, @Param("updateUser") Long updateUser, @Param("id") Long id);

    @Delete("delete from dish where dish_id = #{id};")
    int deleteById(Long id);
}
